﻿using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using System.Xml;

namespace DotnetFramework.CAP.IocRefction
{
    public class ContainerBuilder
    {
        IContainer _container;
        public ContainerBuilder()
        {
            _container = new Container(this);
        }
        public IContainer Build()
        {
            return _container;
        }
        #region Register begin
        public ContainerBuilder Register<T, T2>(Func<object, object> func)
        {
            return _container.Register<T, T2>(func);
        }
        public ContainerBuilder RegisterInstance<T, T2>(T instance)
        {
            return _container.RegisterInstance<T, T2>(instance);
        }
        public ContainerBuilder RegisterGeneric(Type type, Type serverType, bool isSingle = false)
        {
            return _container.RegisterGeneric(type, serverType, isSingle);
        }
        public ContainerBuilder RegisterGenericNamed(Type type, Type serverType, string name, bool isSingle = false)
        {
            return _container.RegisterGenericNamed(type, serverType, name, isSingle);
        }
        public ContainerBuilder RegisterType<T, T2>(bool isSingle = false)
        {
            return _container.RegisterType<T, T2>(isSingle);
        }
        public ContainerBuilder RegisterType<T>(bool isSingle = false)
        {
            return _container.RegisterType<T, T>(isSingle);
        }
        public ContainerBuilder RegisterTypeNamed<T, T2>(string typeName, bool isSingle = false)
        {
            return _container.RegisterTypeNamed<T, T2>(typeName, isSingle);
        }
        public ContainerBuilder TryAddEnumerable(Type type, Type serverType)
        {
            return _container.TryAddEnumerable(type, serverType);
        }
        #endregion Register end
    }
}
